package com.yingsheng.bi.hks.web.controller;


import com.yingsheng.bi.hks.dto.addr.*;
import com.yingsheng.bi.hks.feign.client.AddrFeignClient;
import com.yingsheng.bi.hks.service.addr.AddrMgmtService;
import com.yingsheng.bi.hks.template.annotation.Template;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

/**
 * 收货地址管理
 *
 * @author 83686
 */
@RestController
public class AddrCtrl implements AddrFeignClient {

    @Autowired
    private AddrMgmtService addrMgmtService;

    @Template(name = "accessTransTemplate")
    @Override
    public AddrAddRes add(@Validated AddrAddReq req) {
        return addrMgmtService.add(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public AddrModRes mod(@Validated AddrModReq req) {
        return addrMgmtService.mod(req);
    }

    @Template(name = "accessQueryTemplate")
    @Override
    public AddrQryRes qry(@Validated AddrQryReq req) {
        return addrMgmtService.qry(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public AddrDelRes del(@Validated AddrDelReq req) {
        return addrMgmtService.del(req);
    }
}
